/** index.html **/
$(function() {
    new Swipe(document.getElementById('focus'), {
        speed: 500,
        auto: 3000,
        callback: function() {
            var lis = $(this.element).next("ol").children();
            lis.removeClass("on").eq(this.index).addClass("on");
        }
    });

    new Swipe(document.getElementById('focus'), {
        speed: 500,
    });
});

//鼠标悬停切换图片
$("#three1").mouseenter(function() {
    setTab('three', 1, 3);
});

$("#three2").mouseenter(function() {
    setTab('three', 2, 3);
});

$("#three3").mouseenter(function() {
    setTab('three', 3, 3);
});

/** download_wechat.html **/
$(document).ready(function() {
    var ali = $('#lunbonum li');
    var aPage = $('#lunhuanback p');
    var aslide_img = $('.lunhuancenter b');
    var iNow = 0;
    aPage.eq(0).css({
        "opacity": 1
    });
    ali.each(function(index) {
        $(this).mouseover(function() {
            slide(index);
        })
    });
    function slide(index) {
        iNow = index;
        ali.eq(index).addClass('lunboone').siblings().removeClass();
        aPage.eq(index).siblings().stop().animate({
            opacity: 0
        },
        600);
        aPage.eq(index).stop().animate({
            opacity: 1
        },
        600);
        aslide_img.eq(index).stop().animate({
            opacity: 1,
            top: -10
        },
        600).siblings('b').stop().animate({
            opacity: 0,
            top: -40
        },
        600);
    }

    function autoRun() {
        iNow++;
        if (iNow == ali.length) {
            iNow = 0;
        }
        slide(iNow);
    }
    setInterval(autoRun, 5000);

})

function resize() {
    var height = document.documentElement.clientHeight || document.body.clientHeight;
    var width = document.documentElement.clientWidth || document.body.clientWidth;
    if (width > 1024) {

        $(".lunhuan").css({
            "width": width,
            "height": height
        });
        $(".lunhuan img").css({
            "width": width,
            "visibility": "visible"
        });
    } else {
        $(".lunhuan").css({
            "width": width,
            "height": height
        });
        //$(".lunhuan img").css({"visibility":"hidden"});
    }
}
//微信图片展示    
$(".wx-box dl").hover(function() {
    $(this).find("dd").fadeIn();
},
function() {
    $(this).find("dd").hide();
});
$("#lunhuan").click(function() {
    $(".wx-box dl dd").hide();
});

//微信图片展示    
$(".wechat-box dl").hover(function() {
    $(this).find("dd").fadeIn();
},
function() {
    $(this).find("dd").hide();
});
$("#lunhuan").click(function() {
    $(".wechat-box dl dd").hide();
});

/** 帮助中心  **/

$("#five1").find("img").show();
$("#five1").find("span").stop().animate({
    width: 170 + "px",
},
1000);

WordAnimates($("#five1"), $("#five2"), $("#five3"), $("#five4"), $("#five5"));
WordAnimates($("#five2"), $("#five1"), $("#five3"), $("#five4"), $("#five5"));
WordAnimates($("#five3"), $("#five1"), $("#five2"), $("#five4"), $("#five5"));
WordAnimates($("#five4"), $("#five1"), $("#five3"), $("#five2"), $("#five5"));
WordAnimates($("#five5"), $("#five1"), $("#five3"), $("#five4"), $("#five2"));
function WordAnimates(obj, obj2, obj3, obj4, obj5) {
    obj.on("click",
    function() {

        $(this).find("img").show();
        $(this).find("span").animate({
            width: 170 + "px",
        },
        500);

        obj2.find("img").hide();
        obj2.find("span").animate({
            width: 0 + "px",
        },
        500);

        obj3.find("img").hide();
        obj3.find("span").animate({
            width: 0 + "px",
        },
        500);

        obj4.find("img").hide();
        obj4.find("span").animate({
            width: 0 + "px",
        },
        500);

        obj5.find("img").hide();
        obj5.find("span").animate({
            width: 0 + "px",
        },
        500);
    })
}